package com.fortune.dao;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.fortune.dto.in.dOrder.DOrderAddDto;
import com.fortune.dto.in.dOrder.DOrderDetailAddDto;
import com.fortune.dto.in.dOrder.DOrderEditDto;
import com.fortune.dto.in.dOrder.DOrderListDto;
import com.fortune.dto.in.distributorOrder.DistributorOrderEditDto;
import com.fortune.entity.DUserInfo;
import com.fortune.entity.MProductInfo;
import com.fortune.vo.dOrder.DOrderDetail;
import com.fortune.vo.dOrder.DOrderInfo;

public interface DOrderDao {
	/**
	 * 经销商订单列表
	 * @param distributorOrderMgtListDto
	 * @return
	 */
	List<DOrderInfo> list(@Param("dUserInfo")DUserInfo dUserInfo,@Param("dOrderListDto")DOrderListDto dOrderListDto);
	
	int count(@Param("dUserInfo")DUserInfo dUserInfo,@Param("dOrderListDto")DOrderListDto dOrderListDto);
	
	/**
	 * 经销商订单详情
	 * @param orderId
	 * @return
	 */
	DOrderDetail detail(@Param("dUserInfo")DUserInfo dUserInfo,@Param("orderId")String orderId);

	int findDiscMoney(@Param("did")String did,@Param("mid")String mid,@Param("proId")String proId);

	MProductInfo mProductInfo(@Param("dUserInfo")DUserInfo dUserInfo,@Param("detailAddDto")DOrderDetailAddDto detailAddDto);

	int findRepeatNumber(@Param("mid")String mid,@Param("did")String did,@Param("no")String no);

	int add(@Param("dUserInfo")DUserInfo dUserInfo,@Param("addDto")DOrderAddDto addDto,@Param("id")String id,@Param("pTotalPrice")BigDecimal pTotalPrice,@Param("dTotalPrice")BigDecimal dTotalPrice);
	
	int addDetail(@Param("dUserInfo")DUserInfo dUserInfo,@Param("mcdid") String mcdid,@Param("dOrderDetailAddDto")DOrderDetailAddDto dOrderDetailAddDto,@Param("id")String id,@Param("totalPrice")BigDecimal totalPrice,@Param("boxTotalPrice")BigDecimal boxTotalPrice,@Param("price")BigDecimal price);
	
	int edit(@Param("editDto")DOrderEditDto editDto,@Param("dUserInfo")DUserInfo dUserInfo,@Param("pTotalPrice")BigDecimal pTotalPrice,@Param("dTotalPrice")BigDecimal dTotalPrice);
	
	int deleteDetal(@Param("editDto")DOrderEditDto editDto,@Param("dUserInfo")DUserInfo dUserInfo);
	
	int delete(@Param("dUserInfo")DUserInfo dUserInfo,@Param("orderId")String orderId);

	String findMcdid(@Param("mid") String mid,@Param("mpid") String mpid);
}
